home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Applications
/
mint
/
bin
/
crtype
< prev
next >
Wrap
Text File
|
1994-04-23
|
424b
|
21 lines
#!/usr/bin/perl
# usage: perl crtype <file...>
# tell what kind of end of line convention is used.
while ($file = shift(@ARGV)) {
last unless open(F, "<$file");
binmode(F);
while (1) {
$type = "Unknown";
last unless read(F, $buf, 1024);
$type = "DOS";
last if $buf =~ "\r\n";
$type = "Mac";
last if $buf =~ "\r";
$type = "UNIX";
last if $buf =~ "\n";
}
print "'$file': $type\n";
close(F);
}